<?php

namespace app\api\controller;
use  app\common\controller\DBase;
use  app\api\logic\UploadTestLogic;
use app\common\library\Upload;
use app\product\logic\ProductLogic;

class UploadInfo  extends DBase
{

    /**
     * @desc    上传图片信息
     * @author  luckyXiong
     * @date    2024-07-03
     */
    public function uploadImages(){
        $file   = $this->request->file('file');
        return  (new UploadTestLogic())->upload_image($file);
    }

    /**
     * @desc    上传视频信息
     * @author  luckyXiong
     * @date    2024-07-03
     */
    public function uploadVideo(){
        $file   = $this->request->file('file');
        return  (new UploadTestLogic())->uploadVideoOSS($file);
    }



    /**
     * @desc    上传图片信息
     * @author  luckyXiong
     * @date    2025-03-04
     */
    public function upload_shopify_image(){
        $params  = $this->request->post();
        $res     = (new UploadTestLogic())->upload_shopify_image($params);
        return  $this->jsonMessage(200,true,'操作成功','');
    }



    /**
     * @desc    上传地址图片
     * @author  luckyXiong
     * @date    2024-07-03
     */
    public function uploadUrlImages(){
        $params  = $this->request->post();
        return  (new UploadTestLogic())->upload_urls($params);
    }


    /**
     * @desc    上传EXCEL数据
     * @author  luckyXiong
     * @date    2024-07-10
     */
    public function uploadExcel(){
        $file       = $this->request->file('file');
        $res        = (new Upload($file))->upload(null, 1);
        (new UploadTestLogic())->uploadExcel($res['url']);
        return  $this->jsonMessage(200, true, '操作成功',null);
    }




    /**
     * @desc    sku图片更新生产方法
     * @author  luckyXiong
     * @date    2025-03-07
     */
    public function uploadUrlImagesproduce(){
        $params  = $this->request->post();
        return  (new UploadTestLogic())->uploadUrlImagesproduce($params);
    }










}